<?php
class CheckReplanting{
	private $no_pancang;
	private $db;
	
	function CheckReplanting($db=NULL, $no_pancang=NULL){
		$this->no_pancang 	 = $no_pancang;
		$this->db 			 = $db;
	}	
	
	function response(){
		$q = "SELECT COUNT(*) FROM `caramel_managerial`.`pancang` WHERE `no_pancang`='".$this->no_pancang."'";
		$r = $this->db->get_var($q);
		
		if( $r > 0 )
			echo "true";
		else
			echo "false";
	}	
}

$no_pancang	= $_GET['no_pancang'];


// load database class handler
include_once '../config/db_config.php';
include '../library/ezsql/shared/ez_sql_core.php';
include '../library/ezsql/mysql/ez_sql_mysql.php';

// database handler
$db = new ezSQL_mysql($dbUser, $dbPass, $dbName, $dbHost);

$finder = new CheckReplanting($db, $no_pancang);
$finder->response();
?>